/*

 @name    : 锅巴汉化 - Web汉化插件
 @author  : 麦子、JAR、小蓝、好阳光的小锅巴
 @version : V0.6.1 - 2019-07-09
 @website : http://www.g8hh.com

*/

//1.汉化杂项
var cnItems = {
    _OTHER_: [],

    //未分类：
    'Save Manually': '手动保存',
    'Export': '导出',
    'Export/Import': '导出/导入',
    'EP Bonus': '进化点奖励',
    'Import': '导入',
    'InfinityV': '无限V',
    '/sec': '/秒',
    '\'Lowest\' will show the square with the least upgrades, then least nanites.': '“最低”展示的是升级次数最少，纳米材料最少的方块。',
    'Capture all the Squares and improve them before changing levels': '捕获所有方块并在更改级别之前对其进行改进',
    'Click and drag to select multiple.': '单击并拖动以选择多个。',
    'Click Export to export to your clipboard (ctrl-v somewhere else).': '单击导出以导出到剪贴板（在其他位置按ctrl-v）。',
    'Click on the starting Square and upgrade it.': '单击开始的方块并将其升级。',
    'Click the edges of the screen (or right click and drag) to scroll around': '单击屏幕的边缘（或右键单击并拖动）以滚动',
    'Cost goes up every bonus level, but nanite production doubles. The first bonus level is at 10, then every 25, increasing later.': '成本每提高一个奖金级别都会上升，但纳米矿产量却翻倍。 第一个奖金级别为10，然后每25个级别，随后增加。',
    'Every second, a Square generates its own nanites, and sends nanites to another Square.': '每秒，一个方块生成自己的纳米粒子，然后将纳米粒子发送到另一个方块。',
    'Nanites Sent per second = Transfer Rate * Total Nanites': '每秒发送的纳米机器 =传输速率* 纳米机器总数',
    'Paste a save and click Import to import.': '粘贴存档，然后单击导入以导入。',
    'Point it at the Square you want to activate next.': '将其指向您要接下来激活的方块。',
    'Press enter / space to buy upgrades of the selected': '按回车 /空格购买所选产品的升级',
    'Press shift WASD / arrow keys to select the next square': '按shift WASD /箭头键选择下一个正方形',
    'Press the WASD / arrow keys to change direction, X to remove direction': '按WASD /箭头键更改方向，按X删除方向',
    'Sorry for lag when pasting save.': '抱歉，保存时出现延迟。',
    'The total nanite consume cost of a level goes up 2x per level.': '一个等级的总纳米消耗成本每等级上升2倍。',
    'Autobuy Max Level': '自动购买最高等级',
    'click here': '点这里',
    'Cost': '成本',
    'Next Cost': '下一个成本',
    'To all existing players': '',
    'Average': '平均',
    'Amount': '数量',
    'Autobuy': '自动购买',
    'Autobuy ': '自动购买 ',
    'Growth': '成长',
    'Highest': '最高',
    'Help (H': '帮助 (H',
    'Highest Level': '最高等级',
    'Level (L': '等级 (L',
    'Level': '等级',
    'Lowest': '最低',
    'Nanites': '纳米',
    'Net': '网',
    'Next': '下一个',
    'None': '无',
    'Next Level': '下一级',
    'Off': '关闭',
    'On': '开启',
    'You will get': '你会得到',
    'You will keep up to 1000 EP from your existing file.': '将从您的现有文件保留最多1000进化点。',
    'When selecting multiple Squares,': '当选择多个方块时，',
    'When selecting multiple Squares, the borders colors are': '当选择多个正方形时，边框颜色为',
    'When buying an upgrade for multiple Squares': '当购买多个方块的升级时',
    'When clicking Squares on the grid': '当在网格上点击方块时',
    'Total': '总计',
    'Total EP': '总计进化点',
    'Total Achievement Bonus': '总计成就加成',
    'Total bonus from growth: x': '总计成长加成 x',
    'This Level': '本级',
    'the upgrade amount/cost will': '升级数量/费用将',
    'The same color': '相同颜色',
    'Stats (I': '统计 (I',
    'Settings (Q': '设置 (Q',
    'Sent': '发送',
    'Received': '已收到',
    'Reset Current Level': '重置当前等级',
    'Select One': '选择一个',
    'this link': '本链接',
    'Unlock Next for': '解锁下一个以',
    'Upgrade Amount': '升级数量',
    'Upgrades (U': '升级 (U',
    'WARNING: Import will break the game if invalid save. Empty import will hard clear the game': '警告：如果存档无效，导入将破坏游戏。 空导入将很难清除游戏',
    'You will gain evolution points equal to ((Level # + 1)^2 * 1.3^(Average Square\'s Bonus)) * (Achievement Bonus': '你将获得相当于((等级# + 1)^2 * 1.3^(平均方块加成))*(成就加值)的进化点',
    'Switching levels or resetting will prestige you, removing most upgrades': '切换级别或重置将提升你的声望，移除大部分升级',
    'Nanite Cost Reduction': '降低纳米成本',
    '% Cost Reduction': '% 成本降低',
    '% more nanite production': '% 更多纳米产量',
    'Autobuy Max Amt. To Spend': '自动购买最大数量去消耗',
    'Available EP': '可用进化点',
    'Avg. Per Level': '平均每级',
    'Avg. EP Per Level': '平均每级进化点',
    'Because this is an entirely new game, your save has been reset.': '因为这是一个全新的游戏，你的存档已被重置。',
    'Both': '都',
    'Buy Squares with lowest upgrade amount, all together': '购买升级量最低的方块，全部一起',
    'Buy Squares with lowest upgrade amount, each tries': '购买升级量最低的方块，每次尝试',
    'Click here to close this message.': '点击这里关闭此消息。',
    'Confirm new level': '新等级确认',
    'Consume Cost': '消耗成本',
    'Created': '已创建',
    'Current Level': '当前等级',
    'EP Upgrades': '进化点升级',
    'Default': '默认',
    'Currently you have': '你当前有',
    'Current Transfer Rate': '当前传输效率',
    'Current Tick Speed': '当前周期速度',
    'Equilibrium': '平衡',
    'Every Square tries to buy': '每个方块尝试购买',
    'Grid Font Color': '网格字体颜色',
    'Happy consuming!': '消费愉快！',
    'Hyper Visible': '超清晰可见',
    'I apologize for the inconvenience, and I will strive avoid such mistakes in the future.': '对于给您带来的不便，我深表歉意，今后我会努力避免此类错误。',
    'I\'ve made significant changes to levels, EP formula, and costs.': '我对等级、进化点公式和成本做了重大的改变。',
    'I\'ve made significant changes to the EP gain formula, as it grew far more than I intended. I\'ve': '我对进化点增益公式做了重大的改变，因为它增长得远远超过我的预期。我',
    'If you have any feedback on the game, please send me a message on reddit using': '如果你对游戏有任何反馈，请在reddit上给我发消息',
    'Levels and EP': '等级和进化点',
    'Lowest Squares are a different color': '最小的方块是不同的颜色',
    'Previous Level': '上一级',
    'permanent EP': '永久进化点',
    'Nanobot Production': '纳米产量',
    'Nanobots Transferred': '纳米传输',
    'evolution points on new level': '进化点在新的等级',
    'evolution points, giving': '进化点，给予',
    'now.': '现在.',
    'Reset Available EP on new level': '在新级别重置可用进化点',
    'Select Active (E': '选择可用 (E',
    'Select Multiple': '选择倍数',
    'Show Last Selected': '显示最后一次选择',
    'Show Lowest': '显示最低',
    'Show what on the Square': '显示方块上有什么',
    'Ticks': '周期',
    'Total Levels': '总计等级',
    'Transfer Rate': '传输速率',
    'Unfortunately, to avoid immediately ruining the game experience, I have to remove large amounts': '不幸的是，为了避免立即破坏游戏体验，我必须删除大量',
    'now changed the formula to be more like what I wanted.': '现在将公式更改为更符合我的需求。',
    'of EP that you already gained. You will keep up to 1000 EP, which for you means you have': '您已经获得的进化点。您最多可以保留1000进化点，这对您来说意味着',
    'For discord,': '在discord,',
    'EP': '进化点',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',

    //原样
    '': '',
    '': '',

}


//需处理的前缀
var cnPrefix = {
    "(-": "(-",
    "(+": "(+",
    "(": "(",
    "-": "-",
    "+": "+",
    " ": " ",
    ": ": "： ",
    "\n": "",
    "                ": "",
    "				": "",
    "             ": "",
    "            ": "",
    "			": "",
    "        ": "",
    "    ": "",
    "Maximum of ": "最大值 ",
    "2/sec": "2/秒 ",
    "Max increase 10 per level": "每级最多增加10",
    "Buy Per Click": "每次点击购买",
    "(Must have enough available EP, and it takes from both available and permanent EP)": "(必须有足够的可用进化点，它从可用进化点和永久进化点中获取)",
}

//需处理的后缀
var cnPostfix = {
    ":": "：",
    "：": "：",
    ": ": "： ",
    "： ": "： ",
    " ": "",
    "/s)": "/s)",
    "/s": "/s",
    ")": ")",
    "%": "%",
    "              ": "",
    "             ": "",
    "            ": "",
    "			": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    " ": "",
    "\n": "",
}

//需排除的，正则匹配
var cnExcludeWhole = [
    /^x?\d+(\.\d+)?[A-Za-z%]{0,2}(\s.C)?\s*$/, //12.34K,23.4 °C
    /^x?\d+(\.\d+)?(e[+\-]?\d+)?\s*$/, //12.34e+4
    /^\s*$/, //纯空格
    /^\d+(\.\d+)?[A-Za-z]{0,2}.?\(?([+\-]?(\d+(\.\d+)?[A-Za-z]{0,2})?)?$/, //12.34M (+34.34K
    /^(\d+(\.\d+)?[A-Za-z]{0,2}\/s)?.?\(?([+\-]?\d+(\.\d+)?[A-Za-z]{0,2})?\/s\stot$/, //2.74M/s (112.4K/s tot
    /^\d+(\.\d+)?(e[+\-]?\d+)?.?\(?([+\-]?(\d+(\.\d+)?(e[+\-]?\d+)?)?)?$/, //2.177e+6 (+4.01+4
    /^(\d+(\.\d+)?(e[+\-]?\d+)?\/s)?.?\(?([+\-]?(\d+(\.\d+)?(e[+\-]?\d+)?)?)?\/s\stot$/, //2.177e+6/s (+4.01+4/s tot
];
var cnExcludePostfix = [
    /:?\s*x?\d+(\.\d+)?(e[+\-]?\d+)?\s*$/, //12.34e+4
    /:?\s*x?\d+(\.\d+)?[A-Za-z]{0,2}$/, //: 12.34K, x1.5
]

//正则替换，带数字的固定格式句子
//纯数字：(\d+)
//逗号：([\d\.,]+)
//小数点：([\d\.]+)
//原样输出的字段：(.+)
var cnRegReplace = new Map([
    [/^\n(.+)Max increase (.+) per level\n(.+)$/, '每级最多增加$2'],
    [/^WARNING: Import will break the game if invalid save. Empty import will hard clear the game\n(.+)$/, '警告：如果存无效，导入将破坏游戏。 空导入将硬复位游戏↵'],
    [/^\+(.+) Transfer Rate$/, '\+$1 传输速率'],
    [/^\+(.+) Max Level$/, '\+$1 最大等级'],
    [/^\+(.+) Max Spent$/, '\+$1 最大消耗'],
    [/^\+(.+) Tick Speed$/, '\+$1 周期速度'],
    [/^Usages: (\d+)\/$/, '用途：$1\/'],
    [/^workers: (\d+)\/$/, '工人：$1\/'],

]);
